package com.vote.admin.controller;

import com.vote.admin.service.AdminViewService;
import com.vote.admin.service.AdminVisitService;
import com.vote.admin.vo.result.ViewResult;
import com.vote.admin.vo.result.VisitResult;
import com.vote.common.returns.RespEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin-visit")
@Slf4j
@Api(value = "管理平台访问量统计", tags = "管理平台访问量统计")
public class AdminVisitController {

    @Resource
    private AdminVisitService adminVisitService;

    @GetMapping("/pv")
    @ApiOperation(value = "访问量统计")
    public RespEntity<VisitResult> hour() {
        RespEntity<VisitResult> respEntity = adminVisitService.visitList();
        return respEntity;
    }

}
